import  requests
import re
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

url='https://passport.cnblogs.com/user/signin'
headers={
    'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0',
    'Accept':'application/json, text/javascript, */*; q=0.01',
    'Accept-Language':'zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3',
    'Accept-Encoding':'gzip, deflate, br',
    'Content-Type':'application/json; charset=utf-8',
    'X-Requested-With':'XMLHttpRequest',
    'Content-Length':'385',
    'Cookie':'_ga=GA1.2.1578020020.1503646785; _gid=GA1.2.1933564343.1504575384; SERVERID=be3c89ac356150692df880e95d4e2e5a|1504584477|1504584448; .CNBlogsCookie=75CD6FC592DA1BFD185A61B872C02244B0CA5EA1D19478C285F8137595882D0C94FC47C8CCDECD9787D4B4FDFD805B0ADB15C2AEF9FDDD70C8AABC621E38F2065F4217CE8C607AEA8670CA702B4DA18DE0946BE7F5C5579F2F9F2526346F7A8CFA8B2E45; .Cnblogs.AspNetCore.Cookies=CfDJ8BMYgQprmCpNu7uffp6PrYYKWk18D6VJm5CcNAlCFBlAUeh6_z-UjOjxlUyjF7Dtp0ukNyxsZsq2rJTgbkOcuUo82T2nLt9ZpRHNUXcm98nzowgiFPkOGIcOTPuONEB0QPd8MNe3MJZGHPkJ83eLZgukNQ0jbdEGryw0jWlKwBTLP7q1F3rWiD7EIWrdewjcSvZGt-fLPY6030GzXeZv3syzck7QR1PJrrli2lVswjOVRAkpUvMD95EI0go61-UBoRqTqfhn0Ll7sWvRng4G6Ac4I-70ejoG2MQhAW1AcPRqWV4nbnPGlDjXzLolgF3Uxw',
}
password={
    "input1":"EI95PagHTI/N1mpbBlAKrO3xmvSQG7MuG8Af2rNAEjYJGyjw+3maabXfNoGx1AX7lvsPt3r8+STHjg7AMiWtDs2oC2wUEhDsRzxrEgxuRdMzush970skrdChqHCdBH9HePFyJp2AnxwT4HvZKTgp5G45149ZPWouLVGwSytO9kU=",
    "input2":"Tl90oXW+tVnVUXG1/UBrcm3WO5fXThtnWnPm2AsbEb/BOfHE9CrO4SYLDEWpndZn2JxiIc+PnJJnc7z7ZwU0bFb44C79qbVWxQcdVCmLQV9RITvfUsTp0b4YK+bDq4W9oYJrThNpZlj9uD77bz4jadQDGuqqi+wQSyUs4mOOgBg=",
    "remember":'True'
}
s=requests.session()
response=s.post(url,headers=headers,json=password,verify=False)
print(response.json())

url01='https://i.cnblogs.com/EditPosts.aspx?opt=1'
bodyCode={
    '__VIEWSTATE':'',
    '__VIEWSTATEGENERATOR':'FE27D343',
    'Editor$Edit$txbTitle':'43',
    'Editor$Edit$EditorBody':'<p>测试02</p>',
    'Editor$Edit$Advanced$ckbPublished':'on',
    'Editor$Edit$Advanced$chkDisplayHomePage':'on',
    'Editor$Edit$Advanced$chkComments':'on',
    'Editor$Edit$Advanced$chkMainSyndication':'on',
    'Editor$Edit$lkbPost':'发布',
}
headers01={
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': '9105',
'Referer': 'https://i.cnblogs.com/EditPosts.aspx?opt=1',
'Cookie': '_ga=GA1.2.1578020020.1503646785; _gid=GA1.2.1933564343.1504575384; SERVERID=be3c89ac356150692df880e95d4e2e5a|1504584477|1504584448; .CNBlogsCookie=75CD6FC592DA1BFD185A61B872C02244B0CA5EA1D19478C285F8137595882D0C94FC47C8CCDECD9787D4B4FDFD805B0ADB15C2AEF9FDDD70C8AABC621E38F2065F4217CE8C607AEA8670CA702B4DA18DE0946BE7F5C5579F2F9F2526346F7A8CFA8B2E45; .Cnblogs.AspNetCore.Cookies=CfDJ8BMYgQprmCpNu7uffp6PrYYKWk18D6VJm5CcNAlCFBlAUeh6_z-UjOjxlUyjF7Dtp0ukNyxsZsq2rJTgbkOcuUo82T2nLt9ZpRHNUXcm98nzowgiFPkOGIcOTPuONEB0QPd8MNe3MJZGHPkJ83eLZgukNQ0jbdEGryw0jWlKwBTLP7q1F3rWiD7EIWrdewjcSvZGt-fLPY6030GzXeZv3syzck7QR1PJrrli2lVswjOVRAkpUvMD95EI0go61-UBoRqTqfhn0Ll7sWvRng4G6Ac4I-70ejoG2MQhAW1AcPRqWV4nbnPGlDjXzLolgF3Uxw',
'Connection': 'keep-alive',
'Upgrade-Insecure-Requests':'1',}
response01=s.post(url01,headers=headers01,data=bodyCode,verify=False)
print(response01.text)

